(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
f(cons(nil, y)) → y
f(cons(f(cons(nil, y)), z)) → copy(n, y, z)
copy(0, y, z) → f(z)
copy(s(x), y, z) → copy(x, y, cons(f(y), z))
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted CpxTRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
f(cons(nil, z0)) → z0
f(cons(f(cons(nil, z0)), z1)) → copy(n, z0, z1)
copy(0, z0, z1) → f(z1)
copy(s(z0), z1, z2) → copy(z0, z1, cons(f(z1), z2))
Tuples:
F(cons(f(cons(nil, z0)), z1)) → c1(COPY(n, z0, z1))
COPY(0, z0, z1) → c2(F(z1))
COPY(s(z0), z1, z2) → c3(COPY(z0, z1, cons(f(z1), z2)), F(z1))
S tuples:
F(cons(f(cons(nil, z0)), z1)) → c1(COPY(n, z0, z1))
COPY(0, z0, z1) → c2(F(z1))
COPY(s(z0), z1, z2) → c3(COPY(z0, z1, cons(f(z1), z2)), F(z1))
K tuples:none
Defined Rule Symbols:
f, copy
Defined Pair Symbols:
F, COPY
Compound Symbols:
c1, c2, c3
(3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)
Removed 2 trailing nodes:
F(cons(f(cons(nil, z0)), z1)) → c1(COPY(n, z0, z1))
COPY(0, z0, z1) → c2(F(z1))
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
f(cons(nil, z0)) → z0
f(cons(f(cons(nil, z0)), z1)) → copy(n, z0, z1)
copy(0, z0, z1) → f(z1)
copy(s(z0), z1, z2) → copy(z0, z1, cons(f(z1), z2))
Tuples:
COPY(s(z0), z1, z2) → c3(COPY(z0, z1, cons(f(z1), z2)), F(z1))
S tuples:
COPY(s(z0), z1, z2) → c3(COPY(z0, z1, cons(f(z1), z2)), F(z1))
K tuples:none
Defined Rule Symbols:
f, copy
Defined Pair Symbols:
COPY
Compound Symbols:
c3
(5) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^2))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
COPY(s(z0), z1, z2) → c3(COPY(z0, z1, cons(f(z1), z2)), F(z1))
We considered the (Usable) Rules:
f(cons(nil, z0)) → z0
And the Tuples:
COPY(s(z0), z1, z2) → c3(COPY(z0, z1, cons(f(z1), z2)), F(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(COPY(x1, x2, x3)) = [3]x1 + [2]x3 + [2]x1·x2
POL(F(x1)) = x1
POL(c3(x1, x2)) = x1 + x2
POL(cons(x1, x2)) = [2]
POL(f(x1)) = 0
POL(nil) = 0
POL(s(x1)) = [3] + x1
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
f(cons(nil, z0)) → z0
f(cons(f(cons(nil, z0)), z1)) → copy(n, z0, z1)
copy(0, z0, z1) → f(z1)
copy(s(z0), z1, z2) → copy(z0, z1, cons(f(z1), z2))
Tuples:
COPY(s(z0), z1, z2) → c3(COPY(z0, z1, cons(f(z1), z2)), F(z1))
S tuples:none
K tuples:
COPY(s(z0), z1, z2) → c3(COPY(z0, z1, cons(f(z1), z2)), F(z1))
Defined Rule Symbols:
f, copy
Defined Pair Symbols:
COPY
Compound Symbols:
c3
(7) SIsEmptyProof (EQUIVALENT transformation)
The set S is empty
(8) BOUNDS(O(1), O(1))